package expandingproject;

import java.util.Random;
import java.util.Scanner;

/**
 *
 * @author Inderpreet
 */
public class GuessingGame {

    public int getComputerNumber() {
        Random rand = new Random();
        int computerNumber = rand.nextInt(10) + 1;
        return computerNumber;
    }

    public int getUsersGuess() {
        Scanner keyb = new Scanner(System.in);
        System.out.println("Enter a number from 1 to 10:");
        int userGuess = Integer.parseInt(keyb.nextLine());
        return userGuess;
    }

    public void makeDecisions(int userGuess, int computerNumber) {
        if (userGuess > computerNumber) {
            System.out.println("Too high!");
        } else if (userGuess < computerNumber) {
            System.out.println("Too low!");
        }
    }

    public void printWinningSequence(int guesses) {
        System.out.println("Right on! It took you "
                + guesses + " guess(es).");
    }

    public void printFinalScore(int plays, int totalGuesses) {
        System.out.println("You played " + plays + " time(s) and "
                + "averaged " + (totalGuesses / plays) + " guess(es) per game.");
    }
}
